Predictive lighting control using load current slew rate for power switching

ABSTRACT

An electronic device is described. The electronic device includes current measuring circuitry configured to measure load current to produce a load current measurement. The electronic device also includes a processor coupled to the current measuring circuitry. The processor is configured to calculate an estimated load current slope based on the load current measurement and to determine a predicted zero-cross point based on the estimated load current slope to minimize damaging voltage spike creation.

RELATED APPLICATIONS

This application is related to and claims priority from U.S. ProvisionalPatent Application Ser. No. 62/748,191, filed Oct. 19, 2018, for“PREDICTIVE LIGHTING CONTROL USING CURRENT SLEW RATE FOR POWERSWITCHING,” with first named inventor Sidney Lyle King.

TECHNICAL FIELD

The present disclosure relates generally to electronic devices. Morespecifically, the present disclosure relates to systems and methods forpredictive lighting control using load current slew rate for powerswitching.

BACKGROUND

In recent years, the price of electronic devices has decreaseddramatically. In addition, the size of electronic devices has continuedto decrease. Further, electronic devices continue to increase incapability and convenience.

Decreasing prices and increasing capabilities of electronic devices haspermitted modern devices to be conveniently used in homes andbusinesses. Many homes and businesses include multiple electronicdevices to assist in everyday tasks. For example, electronic devices maybe used for convenience and/or entertainment.

While some electronic devices may provide convenience and entertainment,many also require control. Moreover, these electronic devices consumeelectrical power. Safety is also a concern with some electronic devices.As can be observed from this discussion, improvements to electronicdevice ease of use, efficiency and/or safety may be beneficial.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating one configuration of anelectronic device for predictive lighting control using load currentslew rate for power switching;

FIG. 2 is a flow diagram illustrating one configuration of a method forpredictive lighting control using load current slew rate for powerswitching;

FIG. 3 is a flow diagram illustrating another configuration of a methodfor predictive lighting control using load current slew rate for powerswitching;

FIG. 4 illustrates examples of waveforms for a line voltage, a loadvoltage and a load current;

FIG. 5 illustrates a rolling average value array; and

FIG. 6 illustrates various components that may be utilized in anelectronic device.

DETAILED DESCRIPTION

An electronic device is described. The electronic device includescurrent measuring circuitry configured to measure load current toproduce a load current measurement. The electronic device also includesa processor coupled to the current measuring circuitry. The processor isconfigured to calculate an estimated load current slope based on theload current measurement and to determine a predicted zero-cross pointbased on the estimated load current slope to minimize damaging voltagespike creation.

The processor may calculate a rolling average of the load current for acurrent sample point. The processor may calculate the rolling averageusing at least ten sample points. The processor may store the rollingaverage in an average value array. The average value array may includerolling averages for a number of sample points.

The processor may determine an average load current difference betweenthe rolling average for the current sample point and a rolling averagefor an earlier sample point. The processor may divide the average loadcurrent difference by a time interval between the current sample pointand the earlier sample point to calculate the estimated load currentslope.

The processor may determine the predicted zero-cross point by adding therolling average of the load current for the current sample point to theestimated load current slope multiplied by a look-ahead value. Thelook-ahead value may include a time interval to compensate for switchingdelays. The processor may determine that the predicted zero-cross pointcrosses an X-axis when the predicted zero-cross point changes sign.

The processor may cause at least one switch to be turned off at thepredicted zero-cross point. The processor may cause the at least oneswitch to be turned off when the predicted zero-cross point changessign. The at least one switch may include a firstmetal-oxide-semiconductor field-effect transistor (MOSFET).

A method is also described. The method includes measuring load currentto produce a load current measurement. The method also includescalculating an estimated load current slope based on the load currentmeasurement. The method further includes determining a predictedzero-cross point based on the estimated load current slope to minimizedamaging voltage spike creation.

A non-transitory computer-readable medium is also described. Thecomputer-readable medium includes executable instructions for measuringload current to produce a load current measurement. Thecomputer-readable medium also includes executable instructions forcalculating an estimated load current slope based on the load currentmeasurement. The computer-readable medium further includes executableinstructions for determining a predicted zero-cross point based on theestimated load current slope to minimize damaging voltage spikecreation.

Some configurations of the systems and methods disclosed herein mayrelate to controlling MOSFETs. MOSFETs may be used to dim lights in aconfiguration where the MOSFETs either block or allow voltage andcurrent to pass from the power lines to the lighting loads.

When a dimmer is connected to a magnetic load, the turn-off timingbecomes important to prevent voltage and/or current spikes (transients).Current will lag voltage when driving magnetic loads. It is desirable toturn off the load precisely when there is no current flowing. Largeundesired voltage transients may be created if the load is turned offtoo early or late. These transients may easily destroy or weakenelectronic components in the dimmer leading to early failure of thedimming module.

In certain configurations, less-than-real-time historical timingmeasurements have been used to analyze and calculate the time to turnoff the load. A phase lag number such as 275 microseconds (μs) would beused to determine the time when the load should be turned off aftersensing voltage zero-cross. This typically can control the load withinabout +/−100 μs of the actual current zero-cross event. Another methodrequires a much more active method to sense and control the circuit whencurrent reaches a zero value +/−a threshold level. The load is thenturned off when the current reaches zero. In some examples, this may bedone at a 20 μs rate. Unfortunately, by the time the load is turned off,the current may have already passed the current zero point by 40 μs to80 μs or more due to MOSFET switching latency. With the current MOSFETdrive channel, either of these methods may result in voltage spikes over600V, which may damage certain electronic parts.

The present systems and methods predict when the current will cross thezero point at some time in the future. This will allow time to commandthe MOSFETs to turn off at the time the current is at a zero value.Since the AC waveform is a periodic sine wave, it can be broken up intomany smaller segments that approximate straight lines. If the systemthen calculates the slope for these straight lines, it can use thisslope to calculate the X-intercept or zero-cross point. By taking thedifference in the current measurements with respect to time, the systemis able to calculate the slope of the current waveform at any givenpoint. It should be noted that the slope of the load current may also bereferred to as the slew rate. In other words, the slew rate is theamount of load current that changes within a specific time interval.

The system can then set a look-ahead value to predict that zero-crossevent, as an example, to 80 μs to 100 μs in the future. This timing canbe adjusted to just about any value depending on switching delays. TheMOSFET devices can then be commanded to be turned off. This alone shouldallow a control tolerance within +−20 μs. If needed, the system mayinterpolate this predicted zero-cross event to provide an even tightercontrol of timing with higher resolution than 20 μs.

As used herein, the term “couple” and other variations thereof (e.g.,“coupled,” “coupling,” etc.) may mean that one element is connected toanother element directly or indirectly. For example, if a first elementis coupled to a second element, the first element may be connecteddirectly to the second element (without any intervening element, forexample) or may be connected to the second element through one or moreother elements. Lines in one or more of the Figures (e.g., in the blockdiagrams) may indicate couplings.

Various configurations are now described with reference to the figures,where like reference numbers may indicate functionally similar elements.The systems and methods as generally described and illustrated in thefigures herein could be arranged and designed in a wide variety ofdifferent configurations. Thus, the following more detailed descriptionof several configurations, as represented in the Figures, is notintended to limit scope, as claimed, but is merely representative of thesystems and methods. As used herein, the term “plurality” may indicatetwo or more. For example, a plurality of components may refer to two ormore components.

FIG. 1 is a block diagram illustrating one configuration of anelectronic device 102 for predictive lighting control using load currentslew rate for power switching. The electronic device 102 may include aprocessor 104 (e.g., a central processing unit (CPU)), current measuringcircuitry 108, zero-cross detect circuitry 106, an amplification andfiltering block 116, a first MOSFET 114 a and a second MOSFET 114 b.Collectively, the first MOSFET 114 a and the second MOSFET 114 b may bereferred to as MOSFETs 114. The processor 104 may be coupled to thecurrent measuring circuitry 108, to the amplification and filteringblock 116 and/or to the MOSFETs 114 (via the amplification and filteringblock 116, for instance).

Examples of electronic devices 102 include electronic circuits,integrated circuits, circuits with discrete components (e.g., resistors,capacitors, transistors, MOSFETs, etc.), computers, and/or devices thatinclude one or more processors, memory cells, latches, logic gates, etc.For instance, the electronic device 102 may be a switch and/or a dimmerthat includes discrete components and a processor 104 (e.g.,microprocessor) that may be used to control switching circuitry. Theprocessor 104 may include and/or access software in memory and/orfirmware. For example, the electronic device 102 may include memory. Thememory may be included on-board the processor or may be separate fromthe processor 104. The memory may store instructions and/or data (e.g.,samples, voltage samples, and/or current samples, etc.). Additionally,or alternatively, the memory or a separate memory may store firmware. Insome configurations, the electronic device 102 may be asemiconductor-based dimmer (e.g., a MOSFET-based dimmer). In someconfigurations, the electronic device 102 may be housed within a wallbox. In some configurations, the electronic device 102 may be housedwithin a panel (e.g., lighting panel).

The electronic device 102 may be coupled to a source 110 (e.g., analternating current (AC) voltage source) and/or to a load 112. Forexample, the electronic device 102 may be coupled to the source 110 on aline 111 coupling (e.g., line 111 terminal). For example, an AC voltagemay be provided to the electronic device 102 through the feed line 111.In some configurations, the source 110 may output an AC voltage (e.g.,240 volts (V), 120 V, etc.). The AC voltage may be provided to theelectronic device 102 between the line 111 (e.g., “hot”) and neutral134. The voltage between the line 111 and neutral 134 may be referred toas line voltage.

The electronic device 102 may be coupled to a load 112. For example, theMOSFETs 114 of the electronic device 102 may be coupled to the load 112.With alternating current, two MOSFETs 114 may be employed in aconfiguration where a first MOSFET 114a controls the current to the load112 and the second MOSFET 114 b is used to control the current comingfrom the load 112. The load 112 may also be coupled to the electronicdevice 102 at neutral 134 (e.g., a neutral line). The MOSFETs 114 mayactivate or deactivate the load 112.

Some load types may include inductive, capacitive, and resistive loadtypes. Inductive load types may have a magnetic inductor of some sort.One example of an inductive load is a magnetic transformer for lowvoltage (e.g., magnetic low voltage (MLV)) lighting. Inductive loadtypes may have a waveform characteristic in which the phase of thecurrent lags (e.g., comes after) the voltage waveform.

Capacitive load types may have a detectable amount of capacitance.Examples of capacitive loads are dimmable LED's, dimmable fluorescentlights and electronic low voltage (ELV) lighting. Capacitive load typesmay have a waveform characteristic in which the phase of the currentleads (e.g., comes before) the voltage waveform. However, somecapacitive loads may exhibit a different waveform characteristic due toa power supply. For example, some capacitive loads may have a waveformcharacteristic in which the phase of the current lags a voltage waveform(e.g., line voltage waveform) due to an activation delay resulting froma power supply.

Resistive load types may exhibit current and voltage waveforms in phasewith each other. For example, there may be no significant (e.g.,discernible) lead or lag between current and voltage in resistive loadtypes. Examples of resistive loads include incandescent and halogenlights.

The electronic device 102 (e.g., processor 104 and/or MOSFETs 114) maycontrol the amount of power delivered to the load 112. In someconfigurations (e.g., switch, dimmer, etc.), the MOSFETs 114 may turn on(e.g., activate) the power or turn off (e.g., deactivate) the power tothe load 112. Additionally or alternatively, the electronic device 102(e.g., processor 104 and/or MOSFETs 114) may adjust the amount of powerthat is delivered to the load 112 (e.g., enable, disable, adjust dutycycle, cut phase, increase phase, etc.).

As observed by this discussion, not all lighting loads are alike.Standard incandescent lamps connected directly to a switch or dimmer canbe switched on and off with little, if any, sensing or control. Theseresistive loads behave very similarly to a resistor connected in acircuit with no electrical reactive behavior. This means that whether aresistive load is connected to an AC or DC power supply, the circuitbehaves the same. LED-type lighting is more complicated than a resistorbut typically behaves like a connected capacitor, which stores a bit ofenergy. Connecting either of these load types to a dimmer or switchcreates little to no adverse waveform distortion.

However, a more finicky type of lamp is connected to a magnetictransformer and then to the dimmer. This configuration may be referredto as magnetic low voltage (MLV) lighting. The magnetics of thislighting technology pose some challenges with possible voltagetransients as a result of improper drive. The more tightly the controland turn-off switching time is correlated with respect to current, thelower the voltage transients.

In an AC circuit, a transformer manifests the lagging relationshipcurrent has with voltage. This relationship may be described in terms oflag, either in terms of degrees or, in the case of this disclosure, intime (e.g., microseconds (μs)). Because AC power follows a gentlychanging sine wave, current and voltage are truly at equilibrium, withno transients in a well-designed transformer system. With an ACwaveform, the voltage and current each take turns at reaching zero ampsor volts. In a resistive system, they both reach zero at the same time.In an inductive circuit (e.g., MLV circuit), voltage reaches zero firstand then current will follow or lag by a certain number of microseconds.If the voltage connection to the dimmer switch (e.g., transformer orMOSFET 114) is removed while there is still current flowing (e.g., theload current is not at zero) a large voltage transient (e.g., over 1 kV)may be generated. This large voltage transient can damage even the mostrobust semiconductors.

In some implementations, an adaptive phase dimmer may use MOSFETs 114 toswitch voltage quickly. The MOSFETs 114 work very well to turn loads onand off. However, the MOSFETs 114 can be damaged if the switchingtransients exceed 600V. A switching error of 100 μs, for example, mayresult in a voltage spike of over 700V. The higher and wider the voltagespike, the more likely the MOSFET 114 will fail. Semiconductorprotection components (e.g., transient voltage suppression or TVS) maybe used to mitigate these transients on the MOSFETs 114. However, theseTVS devices subjected to repeated 600V or more spikes will eventuallyfail, causing the MOSFET 114 to fail and render the channel unusable.

The present systems and methods predict when the load current will crossthe zero point at some time in the future. This will allow time tocommand the MOSFETs 114 to turn off at the time the load current is at azero value.

In some implementations, the AC waveform of the load current is aperiodic sine wave. The AC waveform may be expressed with a Y-axisrepresenting the value of load current and the X-axis may representtime. As used herein, a zero-cross point is the point in time that theload current crosses the X-axis.

The electronic device 102 may include current measuring circuitry 108.The current measuring circuitry 108 may measure the load current (i.e.,the current passed to the load 112) to produce a load currentmeasurement 126. The current measuring circuitry 108 may provide theload current measurement 126 to the processor 104. The waveform of theload current may be captured by taking multiple measurements (alsoreferred to as samples) of the load current at different times (referredto as sample points). In some examples, the sampling rate may be 20 μs,although other sampling rates may be used. The electronic device 102 maystore the raw load current measurement 126 for a number of samplingpoints based on a configured sampling range value (n). In an example,the sampling range value (n) may be 10. In this case, the electronicdevice 102 may store the raw load current measurements 126 for 10sequential load current samples.

The processor 104 may calculate an estimated load current slope based onthe load current measurement 126. The waveform of the load current canbe broken up into many smaller segments that approximate straight lines.If the processor 104 calculates the slope for a straight-lineapproximation of the current waveform, the processor 104 may use thisslope to calculate the X-intercept (also referred to as the zero-crosspoint) for the load current. It should be noted that the sampling pointrange value (n) may be selected such that the sample points areapproximately linear over the sampling point range without being sosmall that noise may dominate the results. For example, it should benoted that because a relatively narrow section of the waveform is beingused (e.g., approximately 200 μs (10 samples times 20 μs)), the waveformsegment and the mathematical model both describe a straight line.

In some examples, the processor 104 may calculate a rolling average ofthe load current for a current sample point. A rolling average (alsoreferred to as a moving average) of the load current may be used todiminish the impact of noise on any one load current measurement 126. Todetermine the rolling average load current for the current sample point,the processor 104 may determine the average load current using the rawload current measurement 126 of the current sample point and a number ofearlier load current measurements 126. In some approaches, a 10-pointspacing may be used with respect to a sampling time (first derivative)such that the system is able to calculate the slope. In an example, therolling average for a given sample point may be calculated according toEquation (1).

$\begin{matrix}{{{AvgAmps}\lbrack n\rbrack} = \frac{{{Amps}\lbrack n\rbrack} + {{Amps}\left\lbrack {n - 1} \right\rbrack} + \ldots + {{Amps}\lbrack 1\rbrack}}{n}} & (1)\end{matrix}$

In Equation (1), AvgAmps[n] is the rolling average load current for acurrent sample point and Amps[n] is raw load current measurement 126 forthe current sample point, Amps[n−1] is the raw load current measurement126 for the prior sample point and so forth until Amps[1], which is thelast raw load current measurement 126 in the sampling range. In the casethat n is 10, the rolling average for the current sampling point is theaverage of the current load current measurement 126 and the prior nineload current measurements 126.

The processor 104 may store the rolling average in a rolling averagevalue array. The rolling average value array may include n rollingaverages for the current and previous sample points. For example, therolling average value array may include the rolling average for thecurrent sample point and the n−1 prior rolling averages. An example of arolling average value array is described in connection with FIG. 5.

In some implementations, the processor 104 may calculate the estimatedload current slope by taking the difference in the current measurementswith respect to time. The processor 104 may calculate the slope of theload current waveform at any given sampling point. The processor 104 maydetermine an average load current difference between the rolling averagefor the current sample point and the rolling average for an earliersample point. The processor 104 may then divide the average load currentdifference by a time interval between the current sample point and theearlier sample point. In an implementation, the estimated load currentslope (Slope) may be determined according to Equation (2).

$\begin{matrix}{{Slope} = \frac{{{AvgAmps}\lbrack n\rbrack} - {{AvgAmps}\lbrack 1\rbrack}}{TimeInterval}} & (2)\end{matrix}$

In Equation (2), AvgAmps[n] is the rolling average for the currentsample point and AvgAmps[1] is the last (i.e., earliest) rolling averageof the sampling point range. In Equation (2), TimeInterval is the timeinterval between the current sample point and the last sample point. Inthe case where the sampling point range value (n) is 10, theTimeInterval may be the time between the current sample point (i.e., themost recently stored value in the rolling average value array) and the10th sampling point. If a rolling average is used (using 10 points inone example configuration) on these calculated slopes, the system willhave a smoothed line to use to predict the X-intercept (i.e., thecurrent zero-cross).

The processor 104 may determine a predicted zero-cross point based onthe estimated load current slope to minimize damaging voltage spikecreation. For example, the processor 104 may add the most recent rollingaverage load current measurement AvgAmps[n] to the load current slopemultiplied by a look-ahead value to determine an estimated futurezero-cross event. This may be expressed according to Equation (3).

ZeroCross=(AvgAmps[n])+(Slope×LookAheadValue)  (3)

In Equation (3), ZeroCross is the predicted zero-cross point where theload current is predicted to be zero. Slope may be determined accordingto Equation (2). The LookAheadValue is the look-ahead value. In someexamples, the look-ahead value may be adjusted to compensate for a timeinterval that is based on switching delays. For example, the look-aheadvalue may be a fixed value that is configured to account for signalpropagation delays, sampling delays, processing delays, switching delaysof MOSFETs 114, etc. In an example to predict that zero-cross event, thelook-ahead value may be set to 80 μs or 100 μs in the future. It shouldbe noted that this timing (i.e., the look-ahead value) can be adjustedto just about any value depending on switching delays.

In some examples, the processor 104 may determine that the predictedzero-cross point crosses the X-axis when the predicted zero-cross pointchanges sign. For example, when the value of the ZeroCross switches frompositive to negative (or from negative to positive), the processor 104may determine that the zero-cross point has been reached. In someimplementations, the processor 104 may interpolate this predictedzero-cross event to provide even tighter control of timing with higherresolution (e.g., greater than 20 μs).

This process may be repeated to detect the zero-cross point. By doingthis iteratively and continuously, the processor 104 may predict anumber of points (e.g., the look-ahead value) into the future when theload current will cross the X-axis. This method alone should allow acontrol tolerance within +−20 μs.

The processor 104 may cause at least one switch (e.g., one or more ofthe MOSFETs 114) to be turned off at the predicted zero-cross point. Forexample, the processor 104 may cause the at least one switch to beturned off when the predicted zero-cross point changes sign. Theprocessor 104 may generate a signal 118 a instructing one or more of theMOSFETs 114 to turn off.

In an implementation, the processor 104 may output an analog voltageramp signal 118 a, which is amplified by the amplification and filteringblock 116. The MOSFETs 114 may include a controlling gate input. Avoltage ramp waveform 118 b received at the controlling gate input maycause the MOSFETs 114 to transition from an off to an on state or froman on state to an off state.

In some implementations, the one or more MOSFETs 114 may be turned offfor a period of time corresponding to an amount of dimming. Forinstance, for 20% dimming, the one or more MOSFETs 114 may be turned offfor 20% of the AC waveform. For 50% dimming, the one or more MOSFETs 114may be turned off for 50% of the AC waveform and so forth.

In some implementations, prediction of the zero-cross point may be basedon the timing of peak detection. For example, the electronic device 102may start the zero-cross prediction when detecting a peak in a voltage(e.g., line voltage or load voltage) or a peak in the load current. Whenthe electronic device 102 detects a peak (e.g., voltage and/or current),the electronic device 102 may begin predicting the zero-cross point asdescribed herein. Upon initiating the zero-cross prediction, thepreviously stored values of the load current measurements 126 and/or therolling average value array may be reset.

In some implementations, the MOSFETs 114 may be turned on based on linevoltage zero-cross. The zero-cross circuitry 106 may detect a linevoltage zero cross (e.g., one or more zero cross times for the linevoltage). For example, the zero-cross circuitry 106 may determine thetime (e.g., position) where the line voltage crosses a zero point. Inother words, the zero-cross circuitry 106 may determine the time whenthe value of the line voltage is zero. The time when the value of theline voltage is zero may be the line voltage zero cross. In someapproaches, the zero-cross circuitry 106 may detect at time at which theline voltage switches from negative to positive or positive to negative.For example, the line voltage zero cross may be determined (e.g.,estimated) as a time between positive and negative voltage samples(e.g., between a last positive voltage sample and a first negativevoltage sample in a cycle or between a last negative voltage sample anda first positive voltage sample). One or more line voltage zerocrossings (e.g., line voltage zero cross timings, time stamps, etc.) maybe stored in memory in some implementations.

In some configurations, the one or more line voltage zero-crossings maybe indicated to the processor 104. For example, the zero-cross circuitry106 may send a zero-cross measurement signal 124 (e.g., a step signal, abit, a code, etc.) to the processor 104 that indicates the timing forthe one or more line voltage zero-crossings. The processor 104 mayutilize the line voltage zero-cross(ings) to control the MOSFETs 114.For example, the processor 104 may control the state of the MOSFETs 114(e.g., one or more states of one or more switches, MOSFETs, etc.) inorder to coordinate the switch activation and/or deactivation with linevoltage zero-cross(ings). Therefore, the activation of the MOSFETs 114may be based on the line voltage zero-cross measurement 124 and thedeactivation of the MOSFETs 114 may be based on the predicted zero-crossof the load current using the load current measurements 126.

In an implementation of the present systems and methods, one set ofresults provides the following. An oscilloscope was used to measure thevoltage transients (spikes) for two different drive levels. In this oneimplementation, it also measured the spikes using the original simplecurrent threshold detect method. The results are presented in Table-1.

TABLE 1 7.5 W LED Load Connected to a Laminated Iron Core Transformer at120 V 20% Dimming Level Original Current Zero-cross Method: 700 VTransient New Slew Rate Method: 108 V Transient New method has a voltagespike that is 6.5 times lower. 50% Dimming Level Original CurrentZero-cross Method: 708 V Transient New Slew Rate Method: 252 V TransientNew method has a spike that is 2.8 times lower.

As demonstrated by these results, the present systems and methodsprovide lower voltage spikes than certain other older current zero-crossmethods.

In some configurations, the electronic device 102 may be a dimmer and/ormay include a dimmer. For example, the MOSFETs may activate and/ordeactivate the load (periodically and/or cyclically, for instance) inorder to achieve a particular dimming level. This may be referred to as“phase-cut” dimming, where different amounts (e.g., time segments,portions, etc.) of load voltage may be cut (e.g., deactivated) in orderto produce different dimming levels. When no portion of the load voltageis cut, the load may be driven in a fully activated state, where thefull cycle of load voltage is provided. This may be referred to as a“full-on” (e.g., 100%) dimming level (e.g., a dimming level of nodimming). A range of cycle portions may be cut according to dimminglevel. For example, a half (e.g., 50%) dimming level may cutapproximately half of the load voltage cycle. Other dimming levels(e.g., 0%, 25%, 33%, 75%, 90%, etc.) may similarly be achieved bycontrolling the MOSFETs 114 to cut corresponding portions from the loadvoltage cycle.

In some configurations, the electronic device 102 may be housed in awall box or lighting panel. For example, the electronic device 102 maybe configured to be contained within a wall box as an electrical device.A wall box (e.g., electrical box, outlet box, switch box, pattress,etc.) is the container for the body of an electrical device (e.g., lightswitch, power outlet, dimmer, etc.). While housed in the wall box, theface of the electrical device may be approximately flush with a wall. Ingeneral, the width of a wall box may be measured in “gangs,” whichindicates the number of electrical devices (e.g., light switches, poweroutlets, dimmers, etc.) that the wall box can hold. For example, asingle-gang wall box may hold a single electrical device and adouble-gang wall box may hold two electrical devices (side by side, forexample). The depth of a wall box may be standard depth, shallow depth,or deep depth. In some configurations of the systems and methodsdisclosed herein, a wall box may be a single-gang standard depth wallbox and a wall box device may be an electronic device 102 that may beheld in a single-gang standard depth wall box. In one configuration, aEuropean style wall box having a width of 86 millimeters, a height of 86millimeters and a depth of 35 millimeters may be used. In anotherconfiguration, a United States style, single-gang, standard depth wallbox may be used. It should be noted that other configurations of thesystems and methods disclosed herein may not be housed in a wall box.For example, some configurations of the systems and methods disclosedherein may be implemented in lighting devices that are not housed inwall boxes. Additionally, or alternatively, a spacer may be utilized insome configurations that places a portion of the device (e.g., anelectronic device 102) outside of a wall box.

A wall box dimmer is another example of an electronic device 102 withvariable states that may be used to control a load 112. A wall boxdimmer may variably adjust the amount of electrical power that is drivento the load 112 (e.g., by adjusting the root mean square (RMS) voltage,adjusting pulse-width modulation, adjusting duty cycle, adjusting aphase cut, etc.). For example, a wall box dimmer may provide 0%electrical power, 100% electrical power or some percentage in between.In one configuration, a wall box dimmer may use one or moresemiconductors (e.g., MOSFETs, transistors, etc.) to control the load112. A simple example of a wall box dimmer is a light dimmer that mayturn on or off and variably control the brightness of a light. Forexample, the light dimmer may increase the brightness of the light byincreasing the amount of electrical power driven to the light.Similarly, the light dimmer may decrease the brightness of the light bydecreasing the amount of electrical power driven to the light. In someconfigurations, the wall box device may include switching and dimmingcapabilities.

It should be noted that one or more of the elements or componentsdescribed in relation to FIG. 1 may be combined and/or divided in someconfigurations. For example, the MOSFETs 114, processor 104,amplification and filtering block 116, zero-cross detect circuitry 106,and/or current measuring circuitry 108 may be divided into smallerelements or components that perform a subset of the functions describedherein. Additionally, or alternatively, one or more of the MOSFETs 114,processor 104, amplification and filtering block 116, zero-cross detectcircuitry 106, and/or current measuring circuitry 108 may be combined.

FIG. 2 is a flow diagram illustrating one configuration of a method 200for predictive lighting control using load current slew rate for powerswitching. The method 200 may be performed by the electronic device 102described in relation to FIG. 1.

The electronic device 102 may measure 202 the load current to produce aload current measurement 126. For example, the electronic device 102 mayinclude current measuring circuitry 108. The current measuring circuitry108 may measure 202 the load current (i.e., the current passed to theload 112) to produce a load current measurement 126.

The electronic device 102 may calculate 204 an estimated load currentslope based on the load current measurement 126. For example, theelectronic device 102 may calculate a rolling average of the loadcurrent for a current sample point. In some implementations, theelectronic device 102 may calculate the rolling average using at leastten sample points. The electronic device 102 may store the rollingaverage in a rolling average value array. The rolling average valuearray may include rolling averages for a number of sample points (e.g.,at least ten sample points). This may be accomplished according toEquation (1).

In an implementation, the electronic device 102 may calculate 204 theestimated load current slope (also referred to as the slew rate) bydetermining the average load current difference between the rollingaverage for the current sample point and a rolling average for anearlier sample point. The electronic device 102 may then divide theaverage load current difference by a time interval between the currentsample point and the earlier sample point. The estimated load currentslope may be determined according to Equation (2).

The electronic device 102 may determine 206 a predicted zero-cross pointbased on the estimated load current slope to minimize damaging voltagespike creation. For example, the electronic device 102 may add the mostrecent rolling average load current measurement (e.g., the rollingaverage load current measurement for the current sample) to theestimated load current slope multiplied by a look-ahead value. This maybe accomplished according to Equation (3). In some implementations, thelook-ahead value may be a time interval that is configured to accountfor switching delays.

In some approaches, the electronic device 102 may cause at least oneswitch to be turned off at the predicted zero-cross point. For example,the electronic device 102 may cause the at least one switch to be turnedoff when the predicted zero-cross point changes sign. The at least oneswitch may include a first metal-oxide-semiconductor field-effecttransistor (MOSFET) 114 a.

FIG. 3 is a flow diagram illustrating another configuration of a method300 for predictive lighting control using load current slew rate forpower switching. The method 300 may be performed by the electronicdevice 102 described in relation to FIG. 1.

The electronic device 102 may measure 302 load current and store the rawload current measurement 126. For example, the electronic device 102 mayinclude current measuring circuitry 108. The current measuring circuitry108 may measure 202 the load current (i.e., the current passed to theload 112) to produce a load current measurement 126.

The electronic device 102 may calculate 304 a rolling average of theload current using the new load current measurement 126. This may beaccomplished according to Equation (1). In some implementations, theelectronic device 102 may calculate the rolling average using at leastten sample points.

The electronic device 102 may store 306 the rolling average in a rollingaverage value array. The rolling average value array may include rollingaverages for a number of sample points (e.g., at least ten samplepoints). An example of a rolling average value array is described inconnection with FIG. 5.

The electronic device 102 may calculate 308 the estimated load currentslope (also referred to as the slew rate) using the difference ofrolling average value array points. For example, the electronic device102 may determine the average load current difference between therolling average for the current sample point and a rolling average foran earlier sample point. The electronic device 102 may then divide theaverage load current difference by a time interval between the currentsample point and the earlier sample point. The estimated load currentslope may be determined according to Equation (2).

The electronic device 102 may determine 310 a predicted zero-cross pointbased on the estimated load current slope and a look-ahead value. Forexample, the electronic device 102 may add the most recent rollingaverage load current measurement AvgAmps[n] to the load current slopemultiplied by a look-ahead value. This may be accomplished according toEquation (3). In some implementations, the look-ahead value may be atime interval that is configured based on switching delays (e.g., signalpropagation delays, sampling delays, processing delays, switching delaysof MOSFETs 114, etc.).

The electronic device 102 may determine 312 whether the predictedzero-cross point has intersected or passed the X-axis. For example, theelectronic device 102 may determine whether the predicted zero-crosspoint changes sign. This may be accomplished by comparing the sign of aprevious calculation of the predicted zero-cross point. If the predictedzero-cross point has not intersected or passed the X-axis (e.g., thesign of the predicted zero-cross point has not changed), then theelectronic device 102 may measure 302 another load current sample.

If the electronic device 102 determines 312 that the predictedzero-cross point has intersected or passed the X-axis (e.g., the sign ofthe predicted zero-cross point has changed), then the electronic device102 may command 314 the MOSFET 114 off. For example, the electronicdevice 102 may generate a signal 118 a that causes one or more of theMOSFETs 114 to turn off. After the switching and processing delay 316,the MOSFET 114 turns off 318. The electronic device 102 may thencontinue to measure 302 load current for the next half-cycle of the loadcurrent waveform.

FIG. 4 illustrates examples of waveforms for a line voltage 430, a loadvoltage 432 and the load current 434. The line voltage 430, load voltage432 and the load current 434 are shown with respect to a Y-axis 436 andan X-axis 438. FIG. 4 also illustrates the samples 426 of the loadcurrent 434 being used to predict the current zero-cross point (i.e.,the location where the load current 434 is predicted to pass the X-axis438). With respect to FIG. 4, the waveforms are illustrated with asample rate 440 of 80 μs, but other sample rates may be used. Otherpossible sample rates may be 20 μs, 40 μs, 60 μs, etc.

FIG. 5 illustrates a rolling average value array 542. Raw current loadmeasurements 526 are shown in relation to time 544. In animplementation, ten raw current load measurements 526 are averaged toarrive at one of the elements (e.g., element n−9) in the array 542. Whenthe next current load measurement 526 is sampled, the oldest raw currentload measurement 526 may be subtracted and the newest raw current loadmeasurement 526 may be added in and stored in the next array position.

Each position in the array 542 may be filled with the oldest beingreplaced by the newest. An index for the newest and the oldest values inthe rolling average value array 542 may be maintained.

One possible formula for calculating a rolling average is shown inEquation (1). The system may store each averaged point in a rolling tenpoint array 542. In one configuration, n=10.

The slope of the load current may be determined by using the slopeformula as shown in Equation (2). Furthermore, if the sampling rate is20 μs, then the Time Interval=number of samples*20 μs. The differenceused to determine the slope of the load current may be the value of thearray 542 at n minus the value of the array 542 at n−9 (e.g., Newestvalue minus Oldest value).

The predicted zero-cross point may be determined using the formula asshown in Equation (3). The LookAheadValue may be the number of sampleperiods the system wants to predict the zero-cross in the future.

FIG. 6 illustrates various components that may be utilized in anelectronic device 602. The electronic device 602 described in connectionwith FIG. 6 may be configured in accordance with the electronic device102 described herein. The electronic device 602 may include a memory601, a communication interface 609, an input device 611, a processor604, an output device 613, a display 615, and/or a display controller617. The memory 601 may store instructions 605 a and data 607 a. Theprocessor 604 may operate on instructions 605 b and data 607 b. Itshould be noted that the display 615 and/or display controller 617 maybe optional. For example, some configurations of the electronic device602 may not have a display. Additionally or alternatively, someconfigurations of the electronic device 602 may include a buttoninterface (e.g., an input device 611). Some configurations of theelectronic device 602 may be controlled on a remote display device(e.g., a touch panel) with communication through a remote device (e.g.,a controller, home automation controller, etc.).

The term “discrete circuit” refers to an electronic circuit built out ofdiscrete components. Examples of discrete components include resistors,capacitors, inductors, transformers, transistors, etc. In someconfigurations, a discrete circuit may not be a solid state integratedcircuit that performs all of the functions described herein. However, adiscrete circuit may include one or more discrete components containedin the same packaging (e.g., bridge rectifier, solid state relay, etc.).In some configurations, a discrete circuit made from discrete componentsrefers to a circuit having separate components or circuits that performindividual finite functions. For instance, examples of a discretecircuit may include load voltage measuring circuitry, switchingcircuitry, a processor, line voltage measuring circuitry, and/or currentmeasuring circuitry that may perform separate and discrete functionswhile being implemented within an electronic device. An electronicdevice may be housed within a wall box. Moreover, each module within anelectronic device may include discrete components or discrete circuits.In some instances, the term “circuit” may refer to a circuit in itsentirety, for example, including the impedance of the wall box deviceand the impedance of the load.

The term “processor” should be interpreted broadly to encompass ageneral purpose processor, a central processing unit (CPU), amicroprocessor, a digital signal processor (DSP), a controller, amicrocontroller, a state machine, and so forth. Under somecircumstances, a “processor” may refer to an application specificintegrated circuit (ASIC), a programmable logic device (PLD), a fieldprogrammable gate array (FPGA), etc. The term “processor” may refer to acombination of processing devices, e.g., a combination of a DSP and amicroprocessor, a plurality of microprocessors, one or moremicroprocessors in conjunction with a DSP core, or any other suchconfiguration.

The term “memory” should be interpreted broadly to encompass anyelectronic component capable of storing electronic information. The termmemory may refer to various types of processor-readable media such asrandom access memory (RAM), read-only memory (ROM), non-volatile randomaccess memory (NVRAM), programmable read-only memory (PROM), erasableprogrammable read-only memory (EPROM), electrically erasable PROM(EEPROM), flash memory, magnetic or optical data storage, registers,etc. Memory is said to be in electronic communication with a processorif the processor can read information from and/or write information tothe memory. Memory that is integral to a processor is in electroniccommunication with the processor.

The terms “instructions” and “code” should be interpreted broadly toinclude any type of computer-readable statement(s). For example, theterms “instructions” and “code” may refer to one or more programs,routines, sub-routines, functions, procedures, etc. “Instructions” and“code” may comprise a single computer-readable statement or manycomputer-readable statements.

The term “computer-readable medium” refers to any available medium thatcan be accessed by a computer or processor. A computer-readable mediummay be non-transitory and tangible. By way of example, and notlimitation, a computer-readable medium may comprise RAM, ROM, EEPROM,CD-ROM or other optical disk storage, magnetic disk storage or othermagnetic storage devices, or any other medium that can be used to carryor store desired program code in the form of instructions or datastructures and that can be accessed by a computer. Disk and disc, asused herein, includes compact disc (CD), laser disc, optical disc,digital versatile disc (DVD), floppy disk, and Blu-ray® disc where disksusually reproduce data magnetically, while discs reproduce dataoptically with lasers.

Software or instructions may also be transmitted over a transmissionmedium. For example, if the software is transmitted from a website,server, or other remote source using a coaxial cable, fiber optic cable,twisted pair, digital subscriber line (DSL), or wireless technologiessuch as infrared, radio, and microwave, then the coaxial cable, fiberoptic cable, twisted pair, DSL, or wireless technologies such asinfrared, radio, and microwave are included in the definition oftransmission medium.

The methods disclosed herein comprise one or more steps or actions forachieving the described method. The method steps and/or actions may beinterchanged with one another without departing from the scope of theclaims. In other words, unless a specific order of steps or actions isrequired for proper operation of the method that is being described, theorder and/or use of specific steps and/or actions may be modifiedwithout departing from the scope of the claims.

It is to be understood that the claims are not limited to the preciseconfiguration and components illustrated above. Various modifications,changes, and variations may be made in the arrangement, operation, anddetails of the systems, methods, and apparatus described herein withoutdeparting from the scope of the claims.

What is claimed is:
 1. An electronic device, comprising: currentmeasuring circuitry configured to measure load current to produce a loadcurrent measurement; and a processor coupled to the current measuringcircuitry, wherein the processor is configured to calculate an estimatedload current slope based on the load current measurement and todetermine a predicted zero-cross point based on the estimated loadcurrent slope to minimize damaging voltage spike creation.
 2. Theelectronic device of claim 1, wherein the processor calculates a rollingaverage of the load current for a current sample point.
 3. Theelectronic device of claim 2, wherein the processor calculates therolling average using at least ten sample points.
 4. The electronicdevice of claim 2, wherein the processor stores the rolling average inan average value array.
 5. The electronic device of claim 4, wherein theaverage value array comprises rolling averages for a number of samplepoints.
 6. The electronic device of claim 2, wherein the processorconfigured to calculate the estimated load current slope comprises theprocessor configured to: determine an average load current differencebetween the rolling average for the current sample point and a rollingaverage for an earlier sample point; and divide the average load currentdifference by a time interval between the current sample point and theearlier sample point.
 7. The electronic device of claim 2, wherein theprocessor configured to determine the predicted zero-cross pointcomprises the processor configured to: add the rolling average of theload current for the current sample point to the estimated load currentslope multiplied by a look-ahead value.
 8. The electronic device ofclaim 7, wherein the look-ahead value comprises a time interval tocompensate for switching delays.
 9. The electronic device of claim 1,wherein the processor is further configured to determine that thepredicted zero-cross point crosses an X-axis when the predictedzero-cross point changes sign.
 10. The electronic device of claim 1,wherein the processor causes at least one switch to be turned off at thepredicted zero-cross point.
 11. The electronic device of claim 10,wherein the processor causes the at least one switch to be turned offwhen the predicted zero-cross point changes sign.
 12. The electronicdevice of claim 10, wherein the at least one switch comprises a firstmetal-oxide-semiconductor field-effect transistor (MOSFET).
 13. Amethod, comprising: measuring load current to produce a load currentmeasurement; calculating an estimated load current slope based on theload current measurement; and determining a predicted zero-cross pointbased on the estimated load current slope to minimize damaging voltagespike creation.
 14. The method of claim 13, further comprisingcalculating a rolling average of the load current for a current samplepoint.
 15. The method of claim 14, wherein calculating the estimatedload current slope comprises: determining an average load currentdifference between the rolling average for the current sample point anda rolling average for an earlier sample point; and dividing the averageload current difference by a time interval between the current samplepoint and the earlier sample point.
 16. The method of claim 14, whereindetermining the predicted zero-cross point comprises: adding the rollingaverage of the load current for the current sample point to theestimated load current slope multiplied by a look-ahead value.
 17. Themethod of claim 13, further comprising causing at least one switch to beturned off at the predicted zero-cross point.
 18. The method of claim13, wherein the at least one switch is caused to be turned off when thepredicted zero-cross point changes sign.
 19. The method of claim 13,wherein the at least one switch comprises a firstmetal-oxide-semiconductor field-effect transistor (MOSFET).
 20. Anon-transitory computer-readable medium, the computer-readable mediumcomprising executable instructions for: measuring load current toproduce a load current measurement; calculating an estimated loadcurrent slope based on the load current measurement; and determining apredicted zero-cross point based on the estimated load current slope tominimize damaging voltage spike creation.